﻿/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2012-2018. All rights reserved.
 * Description:
 * Author: 辛爱国 x30005137
 * Create: 2020-07-28
 * Notes: 无
 */
#include <QGraphicsDropShadowEffect>
#include "aboutdialog.h"
#include "mainwindow.h"
#include <qapplication.h>
#include <QDesktopWidget>
#include <qscreen.h>
#include <QDebug>

AboutDialog::AboutDialog(QWidget *parent) : HWDialog(parent)
{
    setupUi(this);
    setWindowFlags(Qt::FramelessWindowHint | Qt::Tool | Qt::WindowStaysOnTopHint);
    this->labelInstruction->setAlignment(Qt::AlignTop | Qt::AlignHCenter);
    this->setAttribute(Qt::WA_TranslucentBackground);
    QGraphicsDropShadowEffect *shadow_effect = new QGraphicsDropShadowEffect(this);
    shadow_effect->setOffset(0, 0);
    shadow_effect->setColor(Qt::gray);
    shadow_effect->setBlurRadius(10); // 阴影设置半径10
    this->widgetWindow->setGraphicsEffect(shadow_effect);

    ShareServiceController* contorller = ShareServiceController::GetInstance();
    std::string sdkVersion = "";
    if (contorller != NULL) {
         sdkVersion = contorller->GetSDKVersion();
    }
    this->labelVersionValue->setText(QString(sdkVersion.c_str()));
    saveChildrenInfo();
}

AboutDialog::~AboutDialog() {}
void AboutDialog::on_pushButtonExit_clicked()
{
    hide();
}

void AboutDialog::on_pushButtonOK_clicked()
{
    hide();
}
